use serde_json::Value;

/// 获取单位展示数据
pub fn get_snmp_unit_value() -> Value {
    let mut value = serde_json::json!({});
    for (unit, keys) in [(
        "B", "in_and_out,in_flux_count,out_flux_count,\
        memory_used,total_memory,current_memory,memory_free,\
        mem_size"
        ),
        ("Mb/s", "max_speed"),
        ("%", "in_pkt_error_rate,out_pkt_error_rate,mem_usage_percent,mem_usage_threshold,\
        cpu_use_5_seconds,cpu_use_1_minutes,cpu_use_5_minutes,cpu_usage_percent,cpu_usage_threshold,\
        drop_percent"),
        ("ms", "max_held_time,ping_result")
    ] {
        for key in keys.split(',') {
            value[key.trim()] = serde_json::json!(unit);
        }
    }
    value

}
